package cn.nbs.category.web.servlet;

import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.com.hkr.servlet.BaseServlet;
import cn.nbs.category.entity.Category;
import cn.nbs.category.service.CategoryService;

@WebServlet("/CategoryServlet")
public class CategoryServlet extends BaseServlet{
	private CategoryService service = new CategoryService();
	
	
	/**
	 * 查询所有分类
	 * @param request
	 * @param response
	 * @return
	 */
	public String findAll(HttpServletRequest request,HttpServletResponse response){
		
		List<Category> parentList = service.findAll();
		
		request.setAttribute("parents", parentList);
		
		return "f:/jsps/left.jsp";
	}
	
	
	
}
